/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ucm;

import sql.Delete;

/**
 *
 * @author Vitamin
 */
public class DeleteValue {
    private static DeleteValue local;
    private String msg;
    private String[] data;
    private String sql;
    private String out;

    public static DeleteValue getInstance(String tp)
    {
        if(local==null)
        {
            local=new DeleteValue();
            local.msg=tp;
        }
        else
        {
            local.msg=tp;
        }
        return local;
    }

    public String deleteAchivement()
    {
        data=msg.split(";");
        sql="DELETE FROM subjectachievement WHERE student_id='"+data[0]+"' AND course_id='"+data[1]+"' AND teacher_id='"+data[2]+"' " +
                    "AND mark='"+data[3]+"' AND failed='"+data[4]+"' AND marked_date='"+data[5]+"'";
        return out=Delete.getInstance().deleteValue(sql)+";05";
    }

    public String deleteCourse()
    {
        data=msg.split(";");
        sql="DELETE FROM course WHERE course_id='"+data[0]+"'";
        return out=Delete.getInstance().deleteValue(sql)+";07";
    }

}
